package com.gsn.engine.tween;

import java.util.LinkedList;
import java.util.List;

import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Group;

import aurelienribon.tweenengine.BaseTween;
import aurelienribon.tweenengine.Tween;
import aurelienribon.tweenengine.TweenCallback;
import aurelienribon.tweenengine.TweenManager;

public class GsnTween{	
	
	public static List<Tween> toTintGroup(Group target, float duration) {
		int tweenType = ActorAccessor.TINT;
		LinkedList<Tween> list = new LinkedList<Tween>();
		for (Actor actor : target.getActors()){
			if (actor instanceof Group)
				list.addAll(GsnTween.toTintGroup((Group)actor, duration));
			else
				list.add(Tween.to(actor, tweenType, duration));			
		}
		return list;
	}
	
	public static List<Tween> setTintGroup(Group target) {
		int tweenType = ActorAccessor.TINT;
		LinkedList<Tween> list = new LinkedList<Tween>();
		for (Actor actor : target.getActors()){
			if (actor instanceof Group)
				list.addAll(GsnTween.setTintGroup((Group)actor));
			else
				list.add(Tween.set(actor, tweenType));			
		}		
		return list;
	}
	
}
